/**
 *Copyright (c) 2003, 2018, UMF and/or its affiliates. All rights reserved.
 */
package com.umf.b2b.model.pay;

import com.umf.b2b.MerchantBaseRequest;
import com.umpay.dto.UMFResponse.Message;
import com.umpay.util.UMFUtil;

/**
<p>Title:PaymentEntrusted</p>  
<p>Description:��ҵί��֧��-ί��֧���ۿ�</p>
 */
public class PaymentEntrusted extends MerchantBaseRequest{
	
	private String notify_url;
	private String trade_no;//*����ش� [��Ӧ����] ����ƽ̨���ɵı�ʶҵ���׵ı�ţ����֧�����֡�Ӣ����ĸ���ʹ��
	private String mer_trace;//*����ش� [��Ӧ����] ���һ����ȡ��֤Ҫ�ؽӿ���mer_trace����һ��
	private String amount;//*����ش� [��Ӧ����] ֧�����
	private String mer_cust_id;//*����ش� �̻�ƽ̨�����̻������Ψһ���
	private String p_agreement_id;//*����ش� [��Ӧ����]  ֧��Э��� �ͻ�ǩԼ�ɹ�������ƽ̨���ص�֧��Э����
	private String url = "/payment/entrusted";
	
	private String settle_amt;//[��Ӧ����] ������
	private String mer_check_date;//[��Ӧ����] �������ڣ���ʽ��YYYYMMDD

	@Override
	public String getRequestUrl() {
		return baseUrl + url;
	}

	@Override
	public PaymentEntrusted doRequest() throws Exception {
		Message<PaymentEntrusted> response = UMFUtil.post(createAPIContext(), this,PaymentEntrusted.class);
		MerchantBaseRequest baseResult = convertResult(response, PaymentEntrusted.class);
		if(baseResult == null)
			return null;
		return (PaymentEntrusted)baseResult;
	}

	public String getMer_id() {
		return mer_id;
	}

	public void setMer_id(String mer_id) {
		this.mer_id = mer_id;
	}

	public String getTrade_no() {
		return trade_no;
	}

	public void setTrade_no(String trade_no) {
		this.trade_no = trade_no;
	}

	public String getP_agreement_id() {
		return p_agreement_id;
	}

	public void setP_agreement_id(String p_agreement_id) {
		this.p_agreement_id = p_agreement_id;
	}

	public String getNotify_url() {
		return notify_url;
	}

	public void setNotify_url(String notify_url) {
		this.notify_url = notify_url;
	}

	public String getMer_trace() {
		return mer_trace;
	}

	public void setMer_trace(String mer_trace) {
		this.mer_trace = mer_trace;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getMer_cust_id() {
		return mer_cust_id;
	}

	public void setMer_cust_id(String mer_cust_id) {
		this.mer_cust_id = mer_cust_id;
	}

	public String getSettle_amt() {
		return settle_amt;
	}

	public void setSettle_amt(String settle_amt) {
		this.settle_amt = settle_amt;
	}

	public String getMer_check_date() {
		return mer_check_date;
	}

	public void setMer_check_date(String mer_check_date) {
		this.mer_check_date = mer_check_date;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("PaymentEntrusted [mer_id=");
		builder.append(mer_id);
		builder.append(", notify_url=");
		builder.append(notify_url);
		builder.append(", mer_trace=");
		builder.append(mer_trace);
		builder.append(", trade_no=");
		builder.append(trade_no);
		builder.append(", amount=");
		builder.append(amount);
		builder.append(", mer_cust_id=");
		builder.append(mer_cust_id);
		builder.append(", url=");
		builder.append(url);
		builder.append(", p_agreement_id=");
		builder.append(p_agreement_id);
		builder.append(", settle_amt=");
		builder.append(settle_amt);
		builder.append(", mer_check_date=");
		builder.append(mer_check_date);
		builder.append(", version=");
		builder.append(version);
		builder.append(", ret_code=");
		builder.append(ret_code);
		builder.append(", ret_msg=");
		builder.append(ret_msg);
		builder.append(", links=");
		builder.append(links);
		builder.append("]");
		return builder.toString();
	}
}
